<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>客户资金表 管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="capFund_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">
        <div class="fieldBox col_50">
            <div class="label">来款户名</div>
            <div class="field">
                ${capFundVO.comeName}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">来款账号</div>
            <div class="field">
                ${capFundVO.comeCode}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">来款金额</div>
            <div class="field">
                <span id="amount"/>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">收款账户</div>
            <div class="field">
                ${capFundVO.acceptName}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">收款账号</div>
            <div class="field">
                ${capFundVO.acceptCode}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">交易(到账)日期</div>
            <div class="field">
                ${capFundVO.acceptDates}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">实际到账日期</div>
            <div class="field">
                ${capFundVO.acceptActualDates}
            </div>
        </div>

        <div class="fieldBox col_50">
            <div class="label">事业部</div>
            <div class="field">
                <input name="fundBelongOrgCd" id="fundBelongOrgCd" data-value="${capFundVO.fundBelongOrgCd}" validate="{required:true}" placeholder="请选择" ltype="combobox">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">摘要</div>
            <div class="field">
                <textarea name="docketRem" id="docketRem" class="ui-textarea l-textarea" value="${capFundVO.docketRem}"
                          rows="4" cols="120" style="width: 99%;" validate="{required:false,maxlength:2000}">${capFundVO.docketRem}</textarea>
                <input type="text" id="version" name="version" value="${capFundVO.version}" style="display:none;">
            </div>
        </div>
    </div>
    <div class="btnsBox">
        <span id="saveCapFund_Btn" class="sq-button sq-button-round l-dialog-btn-ok">保存</span>
        <span id="closeBtn" class="sq-button sq-button-round co_normal">关闭</span>
        <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
    </div>
</form>
<script>
    $(function () {
        var capFundId = "${capFundVO.id}";//主键ID
        var amount='${capFundVO.amount}';
        if(amount){
            $("#amount").text(parseFloat('${capFundVO.amount}')/100);
        }

        //事业部
        $("#fundBelongOrgCd").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        $("#capFund_form").ligerForm({
            validate: true
        });
        liger.get("fundBelongOrgCd").setData(${fundBelongOrgCdList});

        /*保存*/
        $("#saveCapFund_Btn").click(function (event) {
            var form = liger.get("capFund_form");
            if (!form.valid()) {
                top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            $.ligerDialog.hide();
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: '<%=path%>/capital/capFund/modifyRem.do?id=' + capFundId,
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.$("#searchBtn").click();
                        frameElement.dialog.close();
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });

        /*关闭*/
        $("#closeBtn").click(function (event) {
            frameElement.dialog.close();
        });
    });

</script>
</body>
</html>
